package com.mallcloud.mall.product.api.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@ApiModel(value = "SkuPublishDTO", description = "spu信息")
@Data
public class SkuPublishDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "sku ID")
    private Long skuId;

    @ApiModelProperty(value = "SPU ID")
    private Long spuId;

    @ApiModelProperty(value = "sku名称")
    private String skuName;

    @ApiModelProperty(value = "多个销售属性值id逗号分隔")
    private String attrs;

    //--------------前端传值-----------------------------
    @NotBlank(message = "sku图片不能为空")
    @ApiModelProperty(value = "sku图片")
    private String imgUrl;

    @NotNull(message = "售价不能为空")
    @Min(value = 0, message = "售价不能小于0")
    @ApiModelProperty(value = "售价，整数方式保存")
    private BigDecimal priceFee;

    @NotNull(message = "市场价不能为空")
    @Min(value = 0, message = "市场价不能小于0")
    @ApiModelProperty(value = "市场价，整数方式保存")
    private BigDecimal marketPriceFee;

    @ApiModelProperty(value = "商品编码")
    private String partyCode;

    @ApiModelProperty(value = "商品条形码")
    private String modelId;
    //--------------前端传值-----------------------------

    @ApiModelProperty(value = "商品重量")
    private Double weight;

    @ApiModelProperty(value = "商品体积")
    private Double volume;

    @ApiModelProperty(value = "状态 1:enable, 0:disable")
    private Boolean status;

    // 关联属性
    //--------------前端传值-----------------------------
    @Size(min = 1, message = "属性不能为空")
    @ApiModelProperty(value = "属性")
    private List<AttrOptionDTO> attrOptionList;

    @NotNull(message = "库存不能为空")
    @ApiModelProperty(value = "库存")
    private Integer stock;
    //--------------前端传值-----------------------------
}
